package com.devilvan.betrice.proxy.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.devilvan.betrice.proxy.mapper.ProxyMapper;
import com.devilvan.betrice.proxy.pojo.ProxyPo;
import com.devilvan.betrice.proxy.service.ProxyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Evad.Wu
 * @Description 代理信息 业务逻辑类
 * @date 2022-07-25
 */
@Service
public class ProxyServiceImpl extends ServiceImpl<ProxyMapper, ProxyPo> implements ProxyService {
    @Resource(name = "proxyMapper")
    private ProxyMapper proxyMapper;

    @Override
    public void saveBatchProxyPo(List<ProxyPo> proxyPos) {
        this.saveOrUpdateBatch(proxyPos,proxyPos.size());
    }

    @Override
    public ProxyPo queryOneRandom() {
        return proxyMapper.queryOneRandom();
    }
}
